<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JSON 字符串</title>
</head>
<body>
<script>
    let obj = {
        "name": "abcque",
        "gender": "M",
        "age": 18
    }
    // 无法直接看到
    console.log(obj.toString());

    // 将 JavaScript 对象转换为字符串
    console.log(JSON.stringify(obj));

    let abc = JSON.stringify(obj)

    console.log(typeof abc);

    // 将字符串转换为 JavaScript 对象
    let result = JSON.parse(abc);
    console.log(result);

    let s = JSON.stringify
    console.log(s(obj));


</script>
</body>
</html>